package com.service.alarm;

import java.text.SimpleDateFormat;

import com.service.bean.Road_GpsSignal_Dumper;
import com.service.bean.Road_GpsSignal_Paver;
import com.service.bean.Road_GpsSignal_Roller;
import com.service.bean.Road_MixingSignal;
import com.service.bean.Road_Vehicle;
import com.service.bean.alarm.RoadAlarmInfo;
import com.service.bean.alarm.RoadAlarmRule;
import com.service.bean.other.VariableData;
import com.service.cache.CacheManager;
import com.service.tools.AlarmTool;

public class RoadAlarmFunction {
	/**
	 * yyyy-MM-dd HH:mm:ss
	 */
    SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
	/**
	 * yyyy-MM-dd
	 */
	SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy-MM-dd");
	
	/**
	 * 生产温度过低（07001）
	 * @param vehicle
	 * @param signal
	 * @param rule
	 * @return
	 */
	public RoadAlarmInfo alarm07001(Road_Vehicle vehicle, Road_MixingSignal signal, RoadAlarmRule rule){
		if (null == rule.Value1 || null == rule.Value2) {
			return null;
		}
		VariableData variable = CacheManager.instance().getVariable(signal.equipmentNO);
		if(signal.mixingTemp > Double.valueOf(rule.Value1)){
			variable.lowTempTime07001 = null;
			variable.lastAlarmTime07001 = null;
			variable.beginSignalId07001 = null;
			return null;
		}
		if(variable.beginSignalId07001 == null){
			variable.beginSignalId07001 = String.valueOf(signal.id);
		}
		if(variable.lowTempTime07001 == null){
			variable.lowTempTime07001 = signal.mixingTime;
		}else{
			long time = (signal.mixingTime.getTime() - variable.lowTempTime07001.getTime()) / 1000L;
			if(time > Integer.valueOf(rule.Value2) * 60){
				if(variable.lastAlarmTime07001 == null){
					variable.lastAlarmTime07001 = signal.mixingTime;
					RoadAlarmInfo rai = AlarmTool.createRoadAlarmInfo(vehicle, signal, rule);
					//rai.AlarmInfo = "生产最低温度为[" + rule.Value1 + "℃]，报警时温度为[" + signal.mixingTemp + "℃],持续时间"+ time / 60L + "分" + time % 60L + "秒";
					rai.AlarmInfo = "生产温度过低";
					rai.EquipmentKind = vehicle.equipmentKind;
					rai.BeginSignalId = variable.beginSignalId07001;
					rai.EndSignalId = String.valueOf(signal.id);
					variable.beginSignalId07001 = String.valueOf(signal.id);
					return rai;
				}
				long time1 = (signal.mixingTime.getTime() - variable.lastAlarmTime07001.getTime()) / 1000L;
				if(time1 > Integer.valueOf(rule.Value2)){
					variable.lastAlarmTime07001 = signal.mixingTime;
					RoadAlarmInfo rai = AlarmTool.createRoadAlarmInfo(vehicle, signal, rule);
					//rai.AlarmInfo = "生产最低温度为[" + rule.Value1 + "℃]，报警时温度为[" + signal.mixingTemp + "℃],持续时间"+ time / 60L + "分" + time % 60L + "秒";
					rai.AlarmInfo = "生产温度过低";
					rai.EquipmentKind = vehicle.equipmentKind;
					rai.BeginSignalId = variable.beginSignalId07001;
					rai.EndSignalId = String.valueOf(signal.id);
					variable.beginSignalId07001 = String.valueOf(signal.id);
					return rai;
				}
			}
		}
		return null;
	}
	/**
	 * 生产温度过高（07002）
	 * @param vehicle
	 * @param signal
	 * @param rule
	 * @return
	 */
	public RoadAlarmInfo alarm07002(Road_Vehicle vehicle, Road_MixingSignal signal, RoadAlarmRule rule){
		if (null == rule.Value1 || null == rule.Value2) {
			return null;
		}
		VariableData variable = CacheManager.instance().getVariable(signal.equipmentNO);
		if(signal.mixingTemp < Double.valueOf(rule.Value1)){
			variable.overTempTime07002 = null;
			variable.lastAlarmTime07002 = null;
			return null;
		}
		if(variable.beginSignalId07002 == null){
			variable.beginSignalId07002 = String.valueOf(signal.id);
		}
		if(variable.overTempTime07002 == null){
			variable.overTempTime07002 = signal.mixingTime;
		}else{
			long time = (signal.mixingTime.getTime() - variable.overTempTime07002.getTime()) / 1000L;
			if(time > Integer.valueOf(rule.Value2) * 60){
				if(variable.lastAlarmTime07002 == null){
					variable.lastAlarmTime07002 = signal.mixingTime;
					RoadAlarmInfo rai = AlarmTool.createRoadAlarmInfo(vehicle, signal, rule);
				//	rai.AlarmInfo = "生产最高温度为[" + rule.Value1 + "℃]，报警时温度为[" + signal.mixingTemp + "℃],持续时间"+ time / 60L + "分" + time % 60L + "秒";
					rai.AlarmInfo = "生产温度过高";
					rai.EquipmentKind = vehicle.equipmentKind;
					rai.BeginSignalId = variable.beginSignalId07002;
					rai.EndSignalId = String.valueOf(signal.id);
					variable.beginSignalId07002 = String.valueOf(signal.id);
					return rai;
				}
				long time1 = (signal.mixingTime.getTime() - variable.lastAlarmTime07002.getTime()) / 1000L;
				if(time1 > Integer.valueOf(rule.Value2)){
					variable.lastAlarmTime07002 = signal.mixingTime;
					RoadAlarmInfo rai = AlarmTool.createRoadAlarmInfo(vehicle, signal, rule);
					//rai.AlarmInfo = "生产最高温度为[" + rule.Value1 + "℃]，报警时温度为[" + signal.mixingTemp + "℃],持续时间"+ time / 60L + "分" + time % 60L + "秒";;
					rai.AlarmInfo = "生产温度过高";
					rai.EquipmentKind = vehicle.equipmentKind;
					rai.BeginSignalId = variable.beginSignalId07002;
					rai.EndSignalId = String.valueOf(signal.id);
					variable.beginSignalId07002 = String.valueOf(signal.id);
					return rai;
				}
			}
		}
		return null;
	}
	/**
	 * 运输温度过低（08001）
	 * @param vehicle
	 * @param signal
	 * @param rule
	 * @return
	 */
	public RoadAlarmInfo alarm08001(Road_Vehicle vehicle, Road_GpsSignal_Dumper signal, RoadAlarmRule rule) {
		if (null == rule.Value1 || null == rule.Value2) {
			return null;
		}
		VariableData variable = CacheManager.instance().getVariable(signal.gpsNo);
		if (signal.dumperTemp > Double.valueOf(rule.Value1)) {
			variable.lowTempTime08001 = null;
			variable.lastAlarmTime08001 = null;
			variable.beginSignalId08001 = null;
			return null;
		}
		if (signal.accStatus == 0) {
			variable.lowTempTime08001 = null;
			variable.lastAlarmTime08001 = null;
			variable.beginSignalId08001 = null;
			return null;
		}
		if (variable.beginSignalId08001 == null) {
			variable.beginSignalId08001 = signal.signalId;
		}
		if (variable.lowTempTime08001 == null) {
			variable.lowTempTime08001 = signal.gpsTime;
		} else {
			long time = (signal.gpsTime.getTime() - variable.lowTempTime08001.getTime()) / 1000L;
			if (time > Integer.valueOf(rule.Value2) * 60) {
				if (variable.lastAlarmTime08001 == null) {
					variable.lastAlarmTime08001 = signal.gpsTime;
					RoadAlarmInfo rai = AlarmTool.createRoadAlarmInfo(vehicle, signal, rule);
					// rai.AlarmInfo = "运输最低温度为[" + rule.Value1 + "℃]，报警时温度为[" +
					// temp + "℃],持续时间"+ time / 60L + "分" + time % 60L + "秒";
					rai.AlarmInfo = "运输温度过低";
					rai.EquipmentKind = vehicle.equipmentKind;
					rai.BeginSignalId = variable.beginSignalId08001;
					rai.EndSignalId = signal.signalId;
					variable.beginSignalId08001 = signal.signalId;
					return rai;
				}
				long time1 = (signal.gpsTime.getTime() - variable.lastAlarmTime08001.getTime()) / 1000L;
				if (time1 > Integer.valueOf(rule.Value2) * 60) {
					variable.lastAlarmTime08001 = signal.gpsTime;
					RoadAlarmInfo rai = AlarmTool.createRoadAlarmInfo(vehicle, signal, rule);
					// rai.AlarmInfo = "运输最低温度为[" + rule.Value1 + "℃]，报警时温度为[" +
					// temp + "℃],持续时间"+ time / 60L + "分" + time % 60L + "秒";
					rai.AlarmInfo = "运输温度过低";
					rai.EquipmentKind = vehicle.equipmentKind;
					rai.BeginSignalId = variable.beginSignalId08001;
					rai.EndSignalId = signal.signalId;
					variable.beginSignalId08001 = signal.signalId;
					return rai;
				}
			}
		}
		return null;
	}
	
	/**
	 * 运输温度过高（08002）
	 * @param vehicle
	 * @param signal
	 * @param rule
	 * @return
	 */
	public RoadAlarmInfo alarm08002(Road_Vehicle vehicle, Road_GpsSignal_Dumper signal, RoadAlarmRule rule) {
		if (null == rule.Value1 || null == rule.Value2) {
			return null;
		}
		VariableData variable = CacheManager.instance().getVariable(signal.gpsNo);
		if (signal.dumperTemp < Double.valueOf(rule.Value1)) {
			variable.overTempTime08002 = null;
			variable.lastAlarmTime08002 = null;
			variable.beginSignalId08002 = null;
			return null;
		}
		if (signal.accStatus == 0) {
			variable.overTempTime08002 = null;
			variable.lastAlarmTime08002 = null;
			variable.beginSignalId08002 = null;
			return null;
		}
		if (variable.beginSignalId08002 == null) {
			variable.beginSignalId08002 = signal.signalId;
		}
		if (variable.overTempTime08002 == null) {
			variable.overTempTime08002 = signal.gpsTime;
		} else {
			long time = (signal.gpsTime.getTime() - variable.overTempTime08002.getTime()) / 1000L;
			if (time > Integer.valueOf(rule.Value2) * 60) {
				if (variable.lastAlarmTime08002 == null) {
					variable.lastAlarmTime08002 = signal.gpsTime;
					RoadAlarmInfo rai = AlarmTool.createRoadAlarmInfo(vehicle, signal, rule);
					// rai.AlarmInfo = "运输最高温度为[" + rule.Value1 + "℃]，报警时温度为[" +
					// temp + "℃],持续时间"+ time / 60L + "分" + time % 60L + "秒";
					rai.AlarmInfo = "运输温度过高";
					rai.EquipmentKind = vehicle.equipmentKind;
					rai.BeginSignalId = variable.beginSignalId08002;
					rai.EndSignalId = signal.signalId;
					variable.beginSignalId08001 = signal.signalId;
					return rai;
				}
				long time1 = (signal.gpsTime.getTime() - variable.lastAlarmTime08002.getTime()) / 1000L;
				if (time1 > Integer.valueOf(rule.Value2) * 60) {
					variable.lastAlarmTime08002 = signal.gpsTime;
					RoadAlarmInfo rai = AlarmTool.createRoadAlarmInfo(vehicle, signal, rule);
					// rai.AlarmInfo = "运输最高温度为[" + rule.Value1 + "℃]，报警时温度为[" +
					// temp + "℃],持续时间"+ time / 60L + "分" + time % 60L + "秒";
					rai.AlarmInfo = "运输温度过高";
					rai.EquipmentKind = vehicle.equipmentKind;
					rai.BeginSignalId = variable.beginSignalId08002;
					rai.EndSignalId = signal.signalId;
					variable.beginSignalId08001 = signal.signalId;
					return rai;
				}
			}
		}
		return null;
	}
	/**
	 * 摊铺温度过低（09001）
	 * @param vehicle
	 * @param signal
	 * @param rule
	 * @return
	 */
	public RoadAlarmInfo alarm09001(Road_Vehicle vehicle, Road_GpsSignal_Paver signal, RoadAlarmRule rule) {
		if (null == rule.Value1 || null == rule.Value2) {
			return null;
		}
		VariableData variable = CacheManager.instance().getVariable(signal.gpsNo);
		if (signal.paverTemp > Double.valueOf(rule.Value1)) {
			variable.lowTempTime09001 = null;
			variable.lastAlarmTime09001 = null;
			variable.beginSignalId09001 = null;
			return null;
		}
		if (signal.accStatus == 0) {
			variable.lowTempTime09001 = null;
			variable.lastAlarmTime09001 = null;
			variable.beginSignalId09001 = null;
			return null;
		}
		if (variable.beginSignalId09001 == null) {
			variable.beginSignalId09001 = signal.signalId;
		}
		if (variable.lowTempTime09001 == null) {
			variable.lowTempTime09001 = signal.gpsTime;
		} else {
			long time = (signal.gpsTime.getTime() - variable.lowTempTime09001.getTime()) / 1000L;
			if (time > Integer.valueOf(rule.Value2) * 60) {
				if (variable.lastAlarmTime09001 == null) {
					variable.lastAlarmTime09001 = signal.gpsTime;
					RoadAlarmInfo rai = AlarmTool.createRoadAlarmInfo(vehicle, signal, rule);
					// rai.AlarmInfo = "摊铺最低温度为[" + rule.Value1 + "℃]，报警时温度为[" +
					// temp + "℃],持续时间"+ time / 60L + "分" + time % 60L + "秒";
					rai.AlarmInfo = "摊铺温度过低";
					rai.EquipmentKind = vehicle.equipmentKind;
					rai.BeginSignalId = variable.beginSignalId09001;
					rai.EndSignalId = signal.signalId;
					variable.beginSignalId09001 = signal.signalId;
					return rai;
				}
				long time1 = (signal.gpsTime.getTime() - variable.lastAlarmTime09001.getTime()) / 1000L;
				if (time1 > Integer.valueOf(rule.Value2) * 60) {
					variable.lastAlarmTime09001 = signal.gpsTime;
					RoadAlarmInfo rai = AlarmTool.createRoadAlarmInfo(vehicle, signal, rule);
					// rai.AlarmInfo = "摊铺最低温度为[" + rule.Value1 + "℃]，报警时温度为[" +
					// temp + "℃],持续时间"+ time / 60L + "分" + time % 60L + "秒";
					rai.AlarmInfo = "摊铺温度过低";
					rai.EquipmentKind = vehicle.equipmentKind;
					rai.BeginSignalId = variable.beginSignalId09001;
					rai.EndSignalId = signal.signalId;
					variable.beginSignalId09001 = signal.signalId;
					return rai;
				}
			}
		}
		return null;
	}
	
	/**
	 * 摊铺温度过高（09002）
	 * @param vehicle
	 * @param signal
	 * @param rule
	 * @return
	 */
	public RoadAlarmInfo alarm09002(Road_Vehicle vehicle, Road_GpsSignal_Paver signal, RoadAlarmRule rule) {
		if (null == rule.Value1 || null == rule.Value2) {
			return null;
		}
		VariableData variable = CacheManager.instance().getVariable(signal.gpsNo);
		if (signal.paverTemp < Double.valueOf(rule.Value1)) {
			variable.overTempTime09002 = null;
			variable.lastAlarmTime09002 = null;
			variable.beginSignalId09002 = null;
			return null;
		}
		if (signal.accStatus == 0) {
			variable.overTempTime09002 = null;
			variable.lastAlarmTime09002 = null;
			variable.beginSignalId09002 = null;
			return null;
		}
		if (variable.beginSignalId09002 == null) {
			variable.beginSignalId09002 = signal.signalId;
		}
		if (variable.overTempTime09002 == null) {
			variable.overTempTime09002 = signal.gpsTime;
		} else {
			long time = (signal.gpsTime.getTime() - variable.overTempTime09002.getTime()) / 1000L;
			if (variable.lastAlarmTime09002 == null) {
				if (time > Integer.valueOf(rule.Value2) * 60) {
					variable.lastAlarmTime09002 = signal.gpsTime;
					RoadAlarmInfo rai = AlarmTool.createRoadAlarmInfo(vehicle, signal, rule);
					// rai.AlarmInfo = "摊铺最高温度为[" + rule.Value1 + "℃]，报警时温度为[" +
					// temp + "℃],持续时间"+ time / 60L + "分" + time % 60L + "秒";
					rai.AlarmInfo = "摊铺温度过高";
					rai.EquipmentKind = vehicle.equipmentKind;
					rai.BeginSignalId = variable.beginSignalId09002;
					rai.EndSignalId = signal.signalId;
					variable.beginSignalId09002 = signal.signalId;
					return rai;
				}
			} else {
				long time1 = (signal.gpsTime.getTime() - variable.lastAlarmTime09002.getTime()) / 1000L;
				if (time1 > Integer.valueOf(rule.Value2) * 60) {
					variable.lastAlarmTime09002 = signal.gpsTime;
					RoadAlarmInfo rai = AlarmTool.createRoadAlarmInfo(vehicle, signal, rule);
					// rai.AlarmInfo = "摊铺最高温度为[" + rule.Value1 + "℃]，报警时温度为[" +
					// temp + "℃],持续时间"+ time / 60L + "分" + time % 60L + "秒";
					rai.AlarmInfo = "摊铺温度过高";
					rai.EquipmentKind = vehicle.equipmentKind;
					rai.BeginSignalId = variable.beginSignalId09002;
					rai.EndSignalId = signal.signalId;
					variable.beginSignalId09002 = signal.signalId;
					return rai;
				}
			}
		}
		return null;
	}
	/**
	 * 摊铺速度过低（09003）
	 * @param vehicle
	 * @param signal
	 * @param rule
	 * @return
	 */
	public RoadAlarmInfo alarm09003(Road_Vehicle vehicle, Road_GpsSignal_Paver signal, RoadAlarmRule rule) {
		if (null == rule.Value1 || null == rule.Value2) {
			return null;
		}
		VariableData variable = CacheManager.instance().getVariable(signal.gpsNo);
		if (signal.speed > Double.valueOf(rule.Value1)) {
			variable.lowPaverSpeed09003 = null;
			variable.lastAlarmTime09003 = null;
			variable.beginSignalId09003 = null;
			return null;
		}
		if (signal.accStatus == 0) {
			variable.lowPaverSpeed09003 = null;
			variable.lastAlarmTime09003 = null;
			variable.beginSignalId09003 = null;
			return null;
		}
		if (variable.beginSignalId09003 == null) {
			variable.beginSignalId09003 = signal.signalId;
		}
		if (variable.lowPaverSpeed09003 == null) {
			variable.lowPaverSpeed09003 = signal.gpsTime;
		} else {
			long time = (signal.gpsTime.getTime() - variable.lowPaverSpeed09003.getTime()) / 1000L;
			if (time > Integer.valueOf(rule.Value2) * 60) {
				if (variable.lastAlarmTime09003 == null) {
					variable.lastAlarmTime09003 = signal.gpsTime;
					RoadAlarmInfo rai = AlarmTool.createRoadAlarmInfo(vehicle, signal, rule);
					// rai.AlarmInfo = "摊铺最低速度为[" + rule.Value1 +
					// "km/h]，报警时速度为[" + signal.speed + "km/h],持续时间"+ time / 60L
					// + "分" + time % 60L + "秒";
					rai.AlarmInfo = "摊铺速度过低";
					rai.EquipmentKind = vehicle.equipmentKind;
					rai.BeginSignalId = variable.beginSignalId09003;
					rai.EndSignalId = signal.signalId;
					variable.beginSignalId09003 = signal.signalId;
					return rai;
				}
				long time1 = (signal.gpsTime.getTime() - variable.lastAlarmTime09003.getTime()) / 1000L;
				if (time1 > Integer.valueOf(rule.Value2) * 60) {
					variable.lastAlarmTime09003 = signal.gpsTime;
					RoadAlarmInfo rai = AlarmTool.createRoadAlarmInfo(vehicle, signal, rule);
					// rai.AlarmInfo = "摊铺最低速度为[" + rule.Value1 +
					// "km/h]，报警时速度为[" + signal.speed + "km/h],持续时间"+ time / 60L
					// + "分" + time % 60L + "秒";
					rai.AlarmInfo = "摊铺速度过低";
					rai.EquipmentKind = vehicle.equipmentKind;
					rai.BeginSignalId = variable.beginSignalId09003;
					rai.EndSignalId = signal.signalId;
					variable.beginSignalId09003 = signal.signalId;
					return rai;
				}
			}
		}
		return null;
	}
	/**
	 * 摊铺速度过高（09004）
	 * @param vehicle
	 * @param signal
	 * @param rule
	 * @return
	 */
	public RoadAlarmInfo alarm09004(Road_Vehicle vehicle, Road_GpsSignal_Paver signal, RoadAlarmRule rule) {
		if (null == rule.Value1 || null == rule.Value2) {
			return null;
		}
		VariableData variable = CacheManager.instance().getVariable(signal.gpsNo);
		if (signal.speed < Double.valueOf(rule.Value1)) {
			variable.overPaverSpeed09004 = null;
			variable.lastAlarmTime09004 = null;
			variable.beginSignalId09004 = null;
			return null;
		}
		if (signal.accStatus == 0) {
			variable.overPaverSpeed09004 = null;
			variable.lastAlarmTime09004 = null;
			variable.beginSignalId09004 = null;
			return null;
		}
		if (variable.beginSignalId09004 == null) {
			variable.beginSignalId09004 = signal.signalId;
		}
		if (variable.overPaverSpeed09004 == null) {
			variable.overPaverSpeed09004 = signal.gpsTime;
		} else {
			long time = (signal.gpsTime.getTime() - variable.overPaverSpeed09004.getTime()) / 1000L;
			if (time > Integer.valueOf(rule.Value2) * 60) {
				if (variable.lastAlarmTime09004 == null) {
					variable.lastAlarmTime09004 = signal.gpsTime;
					RoadAlarmInfo rai = AlarmTool.createRoadAlarmInfo(vehicle, signal, rule);
					// rai.AlarmInfo = "摊铺最高速度为[" + rule.Value1 +
					// "km/h]，报警时速度为[" + signal.speed + "km/h],持续时间"+ time / 60L
					// + "分" + time % 60L + "秒";
					rai.AlarmInfo = "摊铺速度过高";
					rai.EquipmentKind = vehicle.equipmentKind;
					rai.BeginSignalId = variable.beginSignalId09004;
					rai.EndSignalId = signal.signalId;
					variable.beginSignalId09004 = signal.signalId;
					return rai;
				}
				long time1 = (signal.gpsTime.getTime() - variable.lastAlarmTime09004.getTime()) / 1000L;
				if (time1 > Integer.valueOf(rule.Value2) * 60) {
					variable.lastAlarmTime09004 = signal.gpsTime;
					RoadAlarmInfo rai = AlarmTool.createRoadAlarmInfo(vehicle, signal, rule);
					// rai.AlarmInfo = "摊铺最高速度为[" + rule.Value1 +
					// "km/h]，报警时速度为[" + signal.speed + "km/h],持续时间"+ time / 60L
					// + "分" + time % 60L + "秒";
					rai.AlarmInfo = "摊铺速度过高";
					rai.EquipmentKind = vehicle.equipmentKind;
					rai.BeginSignalId = variable.beginSignalId09004;
					rai.EndSignalId = signal.signalId;
					variable.beginSignalId09004 = signal.signalId;
					return rai;
				}
			}
		}
		return null;
	}
	/**
	 * 熨平板温度过低（09005）
	 * @param vehicle
	 * @param signal
	 * @param rule
	 * @return
	 */
	public RoadAlarmInfo alarm09005(Road_Vehicle vehicle, Road_GpsSignal_Paver signal, RoadAlarmRule rule) {
		if (null == rule.Value1 || null == rule.Value2) {
			return null;
		}
		VariableData variable = CacheManager.instance().getVariable(signal.gpsNo);
		if (signal.ironPlateTemp > Double.valueOf(rule.Value1)) {
			variable.lowIronPlateTemp09005 = null;
			variable.lastAlarmTime09005 = null;
			variable.beginSignalId09005 = null;
			return null;
		}
		if (signal.accStatus == 0) {
			variable.lowIronPlateTemp09005 = null;
			variable.lastAlarmTime09005 = null;
			variable.beginSignalId09005 = null;
			return null;
		}
		if (variable.beginSignalId09005 == null) {
			variable.beginSignalId09005 = signal.signalId;
		}
		if (variable.lowIronPlateTemp09005 == null) {
			variable.lowIronPlateTemp09005 = signal.gpsTime;
		} else {
			long time = (signal.gpsTime.getTime() - variable.lowIronPlateTemp09005.getTime()) / 1000L;
			if (time > Integer.valueOf(rule.Value2) * 60) {
				if (variable.lastAlarmTime09005 == null) {
					variable.lastAlarmTime09005 = signal.gpsTime;
					RoadAlarmInfo rai = AlarmTool.createRoadAlarmInfo(vehicle, signal, rule);
					// rai.AlarmInfo = "熨平板最低温度为[" + rule.Value1 + "℃]，报警时温度为["
					// + temp + "℃],持续时间"+ time / 60L + "分" + time % 60L + "秒";
					rai.AlarmInfo = "熨平板温度过低";
					rai.EquipmentKind = vehicle.equipmentKind;
					rai.BeginSignalId = variable.beginSignalId09005;
					rai.EndSignalId = signal.signalId;
					variable.beginSignalId09005 = signal.signalId;
					return rai;
				}
				long time1 = (signal.gpsTime.getTime() - variable.lastAlarmTime09005.getTime()) / 1000L;
				if (time1 > Integer.valueOf(rule.Value2) * 60) {
					variable.lastAlarmTime09005 = signal.gpsTime;
					RoadAlarmInfo rai = AlarmTool.createRoadAlarmInfo(vehicle, signal, rule);
					// rai.AlarmInfo = "熨平板最低温度为[" + rule.Value1 + "℃]，报警时温度为["
					// + temp + "℃],持续时间"+ time / 60L + "分" + time % 60L + "秒";
					rai.AlarmInfo = "熨平板温度过低";
					rai.EquipmentKind = vehicle.equipmentKind;
					rai.BeginSignalId = variable.beginSignalId09005;
					rai.EndSignalId = signal.signalId;
					variable.beginSignalId09005 = signal.signalId;
					return rai;
				}
			}
		}
		return null;
	}
	/**
	 * 熨平板温度过高（09006）
	 * @param vehicle
	 * @param signal
	 * @param rule
	 * @return
	 */
	public RoadAlarmInfo alarm09006(Road_Vehicle vehicle, Road_GpsSignal_Paver signal, RoadAlarmRule rule) {
		if (null == rule.Value1 || null == rule.Value2) {
			return null;
		}
		VariableData variable = CacheManager.instance().getVariable(signal.gpsNo);
		if (signal.ironPlateTemp < Double.valueOf(rule.Value1)) {
			variable.overIronPlateTemp09006 = null;
			variable.lastAlarmTime09006 = null;
			variable.beginSignalId09006 = null;
			return null;
		}
		if (signal.accStatus == 0) {
			variable.overIronPlateTemp09006 = null;
			variable.lastAlarmTime09006 = null;
			variable.beginSignalId09006 = null;
			return null;
		}
		if (variable.beginSignalId09006 == null) {
			variable.beginSignalId09006 = signal.signalId;
		}
		if (variable.overIronPlateTemp09006 == null) {
			variable.overIronPlateTemp09006 = signal.gpsTime;
		} else {
			long time = (signal.gpsTime.getTime() - variable.overIronPlateTemp09006.getTime()) / 1000L;
			if (time > Integer.valueOf(rule.Value2) * 60) {
				if (variable.lastAlarmTime09006 == null) {
					variable.lastAlarmTime09006 = signal.gpsTime;
					RoadAlarmInfo rai = AlarmTool.createRoadAlarmInfo(vehicle, signal, rule);
					// rai.AlarmInfo = "熨平板最高温度为[" + rule.Value1 + "℃]，报警时温度为["
					// + temp + "℃],持续时间"+ time / 60L + "分" + time % 60L + "秒";
					rai.AlarmInfo = "熨平板温度过高";
					rai.EquipmentKind = vehicle.equipmentKind;
					rai.BeginSignalId = variable.beginSignalId09006;
					rai.EndSignalId = signal.signalId;
					variable.beginSignalId09006 = signal.signalId;
					return rai;
				}
				long time1 = (signal.gpsTime.getTime() - variable.lastAlarmTime09006.getTime()) / 1000L;
				if (time1 > Integer.valueOf(rule.Value2) * 60) {
					variable.lastAlarmTime09006 = signal.gpsTime;
					RoadAlarmInfo rai = AlarmTool.createRoadAlarmInfo(vehicle, signal, rule);
					// rai.AlarmInfo = "熨平板最高温度为[" + rule.Value1 + "℃]，报警时温度为["
					// + temp + "℃],持续时间"+ time / 60L + "分" + time % 60L + "秒";
					rai.AlarmInfo = "熨平板温度过高";
					rai.EquipmentKind = vehicle.equipmentKind;
					rai.BeginSignalId = variable.beginSignalId09006;
					rai.EndSignalId = signal.signalId;
					variable.beginSignalId09006 = signal.signalId;
					return rai;
				}
			}
		}
		return null;
	}
	/**
	 * 振动转速过低（09007）
	 * @param vehicle
	 * @param signal
	 * @param rule
	 * @return
	 */
	public RoadAlarmInfo alarm09007(Road_Vehicle vehicle, Road_GpsSignal_Paver signal, RoadAlarmRule rule) {
		if (null == rule.Value1 || null == rule.Value2) {
			return null;
		}
		VariableData variable = CacheManager.instance().getVariable(signal.gpsNo);
		if (signal.vibrationSpeed > Double.valueOf(rule.Value1)) {
			variable.lowVibrationSpeed09007 = null;
			variable.lastAlarmTime09007 = null;
			variable.beginSignalId09007 = null;
			return null;
		}
		if (signal.accStatus == 0) {
			variable.lowVibrationSpeed09007 = null;
			variable.lastAlarmTime09007 = null;
			variable.beginSignalId09007 = null;
			return null;
		}
		if (variable.beginSignalId09007 == null) {
			variable.beginSignalId09007 = signal.signalId;
		}
		if (variable.lowVibrationSpeed09007 == null) {
			variable.lowVibrationSpeed09007 = signal.gpsTime;
		} else {
			long time = (signal.gpsTime.getTime() - variable.lowVibrationSpeed09007.getTime()) / 1000L;
			if (time > Integer.valueOf(rule.Value2) * 60) {
				if (variable.lastAlarmTime09007 == null) {
					variable.lastAlarmTime09007 = signal.gpsTime;
					RoadAlarmInfo rai = AlarmTool.createRoadAlarmInfo(vehicle, signal, rule);
					// rai.AlarmInfo = "振动转速最低为[" + rule.Value1 +
					// "r/min]，报警时速度为[" + speed + "r/min],持续时间"+ time / 60L +
					// "分" + time % 60L + "秒";
					rai.AlarmInfo = "振动转速过低";
					rai.EquipmentKind = vehicle.equipmentKind;
					rai.BeginSignalId = variable.beginSignalId09007;
					rai.EndSignalId = signal.signalId;
					variable.beginSignalId09007 = signal.signalId;
					return rai;
				}
				long time1 = (signal.gpsTime.getTime() - variable.lastAlarmTime09007.getTime()) / 1000L;
				if (time1 > Integer.valueOf(rule.Value2) * 60) {
					variable.lastAlarmTime09007 = signal.gpsTime;
					RoadAlarmInfo rai = AlarmTool.createRoadAlarmInfo(vehicle, signal, rule);
					// rai.AlarmInfo = "振动转速最低为[" + rule.Value1 +
					// "r/min]，报警时速度为[" + speed + "r/min],持续时间"+ time / 60L +
					// "分" + time % 60L + "秒";
					rai.AlarmInfo = "振动转速过低";
					rai.EquipmentKind = vehicle.equipmentKind;
					rai.BeginSignalId = variable.beginSignalId09007;
					rai.EndSignalId = signal.signalId;
					variable.beginSignalId09007 = signal.signalId;
					return rai;
				}
			}
		}
		return null;
	}
	/**
	 * 振动转速过高（09008）
	 * @param vehicle
	 * @param signal
	 * @param rule
	 * @return
	 */
	public RoadAlarmInfo alarm09008(Road_Vehicle vehicle, Road_GpsSignal_Paver signal, RoadAlarmRule rule) {
		if (null == rule.Value1 || null == rule.Value2) {
			return null;
		}
		VariableData variable = CacheManager.instance().getVariable(signal.gpsNo);
		if (signal.vibrationSpeed < Double.valueOf(rule.Value1)) {
			variable.overVibrationSpeed09008 = null;
			variable.lastAlarmTime09008 = null;
			variable.beginSignalId09008 = null;
			return null;
		}
		if (signal.accStatus == 0) {
			variable.overVibrationSpeed09008 = null;
			variable.lastAlarmTime09008 = null;
			variable.beginSignalId09008 = null;
			return null;
		}
		if (variable.beginSignalId09008 == null) {
			variable.beginSignalId09008 = signal.signalId;
		}
		if (variable.overVibrationSpeed09008 == null) {
			variable.overVibrationSpeed09008 = signal.gpsTime;
		} else {
			long time = (signal.gpsTime.getTime() - variable.overVibrationSpeed09008.getTime()) / 1000L;
			if (time > Integer.valueOf(rule.Value2) * 60) {
				if (variable.lastAlarmTime09008 == null) {
					variable.lastAlarmTime09008 = signal.gpsTime;
					RoadAlarmInfo rai = AlarmTool.createRoadAlarmInfo(vehicle, signal, rule);
					// rai.AlarmInfo = "振动转速最高为[" + rule.Value1 +
					// "r/min]，报警时速度为[" + speed + "r/min],持续时间"+ time / 60L +
					// "分" + time % 60L + "秒";
					rai.AlarmInfo = "振动转速过高";
					rai.EquipmentKind = vehicle.equipmentKind;
					rai.BeginSignalId = variable.beginSignalId09008;
					rai.EndSignalId = signal.signalId;
					variable.beginSignalId09008 = signal.signalId;
					return rai;
				}
				long time1 = (signal.gpsTime.getTime() - variable.lastAlarmTime09008.getTime()) / 1000L;
				if (time1 > Integer.valueOf(rule.Value2) * 60) {
					variable.lastAlarmTime09008 = signal.gpsTime;
					RoadAlarmInfo rai = AlarmTool.createRoadAlarmInfo(vehicle, signal, rule);
					// rai.AlarmInfo = "振动转速最高为[" + rule.Value1 +
					// "r/min]，报警时速度为[" + speed + "r/min],持续时间"+ time / 60L +
					// "分" + time % 60L + "秒";
					rai.AlarmInfo = "振动转速过高";
					rai.EquipmentKind = vehicle.equipmentKind;
					rai.BeginSignalId = variable.beginSignalId09008;
					rai.EndSignalId = signal.signalId;
					variable.beginSignalId09008 = signal.signalId;
					return rai;
				}
			}
		}
		return null;
	}
	/**
	 * 夯锤转速过低（09009）
	 * @param vehicle
	 * @param signal
	 * @param rule
	 * @return
	 */
	public RoadAlarmInfo alarm09009(Road_Vehicle vehicle, Road_GpsSignal_Paver signal, RoadAlarmRule rule) {
		if (null == rule.Value1 || null == rule.Value2) {
			return null;
		}
		VariableData variable = CacheManager.instance().getVariable(signal.gpsNo);
		if (signal.ramSpeed > Double.valueOf(rule.Value1)) {
			variable.lowRamSpeed09009 = null;
			variable.lastAlarmTime09009 = null;
			variable.beginSignalId09009 = null;
			return null;
		}
		if (signal.accStatus == 0) {
			variable.lowRamSpeed09009 = null;
			variable.lastAlarmTime09009 = null;
			variable.beginSignalId09009 = null;
			return null;
		}
		if (variable.beginSignalId09009 == null) {
			variable.beginSignalId09009 = signal.signalId;
		}
		if (variable.lowRamSpeed09009 == null) {
			variable.lowRamSpeed09009 = signal.gpsTime;
		} else {
			long time = (signal.gpsTime.getTime() - variable.lowRamSpeed09009.getTime()) / 1000L;
			if (time > Integer.valueOf(rule.Value2) * 60) {
				if (variable.lastAlarmTime09009 == null) {
					variable.lastAlarmTime09009 = signal.gpsTime;
					RoadAlarmInfo rai = AlarmTool.createRoadAlarmInfo(vehicle, signal, rule);
					// rai.AlarmInfo = "夯锤转速最低为[" + rule.Value1 +
					// "r/min]，报警时速度为[" + speed + "r/min],持续时间"+ time / 60L +
					// "分" + time % 60L + "秒";
					rai.AlarmInfo = "夯锤转速过低";
					rai.EquipmentKind = vehicle.equipmentKind;
					rai.BeginSignalId = variable.beginSignalId09009;
					rai.EndSignalId = signal.signalId;
					variable.beginSignalId09009 = signal.signalId;
					return rai;
				}
				long time1 = (signal.gpsTime.getTime() - variable.lastAlarmTime09009.getTime()) / 1000L;
				if (time1 > Integer.valueOf(rule.Value2) * 60) {
					variable.lastAlarmTime09009 = signal.gpsTime;
					RoadAlarmInfo rai = AlarmTool.createRoadAlarmInfo(vehicle, signal, rule);
					// rai.AlarmInfo = "夯锤转速最低为[" + rule.Value1 +
					// "r/min]，报警时速度为[" + speed + "r/min],持续时间"+ time / 60L +
					// "分" + time % 60L + "秒";
					rai.AlarmInfo = "夯锤转速过低";
					rai.EquipmentKind = vehicle.equipmentKind;
					rai.BeginSignalId = variable.beginSignalId09009;
					rai.EndSignalId = signal.signalId;
					variable.beginSignalId09009 = signal.signalId;
					return rai;
				}
			}
		}
		return null;
	}
	/**
	 * 夯锤转速过高（09010）
	 * @param vehicle
	 * @param signal
	 * @param rule
	 * @return
	 */
	public RoadAlarmInfo alarm09010(Road_Vehicle vehicle, Road_GpsSignal_Paver signal, RoadAlarmRule rule) {
		if (null == rule.Value1 || null == rule.Value2) {
			return null;
		}
		VariableData variable = CacheManager.instance().getVariable(signal.gpsNo);
		if (signal.ramSpeed < Double.valueOf(rule.Value1)) {
			variable.overRamSpeed09010 = null;
			variable.lastAlarmTime09010 = null;
			variable.beginSignalId09010 = null;
			return null;
		}
		if (signal.accStatus == 0) {
			variable.overRamSpeed09010 = null;
			variable.lastAlarmTime09010 = null;
			variable.beginSignalId09010 = null;
			return null;
		}
		if (variable.beginSignalId09010 == null) {
			variable.beginSignalId09010 = signal.signalId;
		}
		if (variable.overRamSpeed09010 == null) {
			variable.overRamSpeed09010 = signal.gpsTime;
		} else {
			long time = (signal.gpsTime.getTime() - variable.overRamSpeed09010.getTime()) / 1000L;
			if (time > Integer.valueOf(rule.Value2) * 60) {
				if (variable.lastAlarmTime09010 == null) {
					variable.lastAlarmTime09010 = signal.gpsTime;
					RoadAlarmInfo rai = AlarmTool.createRoadAlarmInfo(vehicle, signal, rule);
					// rai.AlarmInfo = "夯锤转速最高为[" + rule.Value1 +
					// "r/min]，报警时速度为[" + speed + "r/min],持续时间"+ time / 60L +
					// "分" + time % 60L + "秒";
					rai.AlarmInfo = "夯锤转速过高";
					rai.EquipmentKind = vehicle.equipmentKind;
					rai.BeginSignalId = variable.beginSignalId09010;
					rai.EndSignalId = signal.signalId;
					variable.beginSignalId09010 = signal.signalId;
					return rai;
				}
				long time1 = (signal.gpsTime.getTime() - variable.lastAlarmTime09010.getTime()) / 1000L;
				if (time1 > Integer.valueOf(rule.Value2) * 60) {
					variable.lastAlarmTime09010 = signal.gpsTime;
					RoadAlarmInfo rai = AlarmTool.createRoadAlarmInfo(vehicle, signal, rule);
					// rai.AlarmInfo = "夯锤转速最高为[" + rule.Value1 +
					// "r/min]，报警时速度为[" + speed + "r/min],持续时间"+ time / 60L +
					// "分" + time % 60L + "秒";
					rai.AlarmInfo = "夯锤转速过高";
					rai.EquipmentKind = vehicle.equipmentKind;
					rai.BeginSignalId = variable.beginSignalId09010;
					rai.EndSignalId = signal.signalId;
					variable.beginSignalId09010 = signal.signalId;
					return rai;
				}
			}
		}
		return null;
	}
	/**
	 * 压实温度过低（A0001）
	 * @param vehicle
	 * @param signal
	 * @param rule
	 * @return
	 */
	public RoadAlarmInfo alarmA0001(Road_Vehicle vehicle, Road_GpsSignal_Roller signal, RoadAlarmRule rule) {
		if (null == rule.Value1 || null == rule.Value2) {
			return null;
		}
		VariableData variable = CacheManager.instance().getVariable(signal.gpsNo);
		if (signal.rollerTemp > Double.valueOf(rule.Value1)) {
			variable.lowRollerTempA0001 = null;
			variable.lastAlarmTimeA0001 = null;
			variable.beginSignalIdA0001 = null;
			return null;
		}
		if (signal.accStatus == 0) {
			variable.lowRollerTempA0001 = null;
			variable.lastAlarmTimeA0001 = null;
			variable.beginSignalIdA0001 = null;
			return null;
		}
		if (variable.beginSignalIdA0001 == null) {
			variable.beginSignalIdA0001 = signal.signalId;
		}
		if (variable.lowRollerTempA0001 == null) {
			variable.lowRollerTempA0001 = signal.gpsTime;
		} else {
			long time = (signal.gpsTime.getTime() - variable.lowRollerTempA0001.getTime()) / 1000L;
			if (time > Integer.valueOf(rule.Value2) * 60) {
				if (variable.lastAlarmTimeA0001 == null) {
					variable.lastAlarmTimeA0001 = signal.gpsTime;
					RoadAlarmInfo rai = AlarmTool.createRoadAlarmInfo(vehicle, signal, rule);
					// rai.AlarmInfo = "压实最低温度为[" + rule.Value1 + "℃]，报警时温度为[" +
					// temp + "℃],持续时间"+ time / 60L + "分" + time % 60L + "秒";
					rai.AlarmInfo = "压实温度过低";
					rai.EquipmentKind = vehicle.equipmentKind;
					rai.BeginSignalId = variable.beginSignalIdA0001;
					rai.EndSignalId = signal.signalId;
					variable.beginSignalIdA0001 = signal.signalId;
					return rai;
				}
				long time1 = (signal.gpsTime.getTime() - variable.lastAlarmTimeA0001.getTime()) / 1000L;
				if (time1 > Integer.valueOf(rule.Value2) * 60) {
					variable.lastAlarmTimeA0001 = signal.gpsTime;
					RoadAlarmInfo rai = AlarmTool.createRoadAlarmInfo(vehicle, signal, rule);
					// rai.AlarmInfo = "压实最低温度为[" + rule.Value1 + "℃]，报警时温度为[" +
					// temp + "℃],持续时间"+ time / 60L + "分" + time % 60L + "秒";
					rai.AlarmInfo = "压实温度过低";
					rai.EquipmentKind = vehicle.equipmentKind;
					rai.BeginSignalId = variable.beginSignalIdA0001;
					rai.EndSignalId = signal.signalId;
					variable.beginSignalIdA0001 = signal.signalId;
					return rai;
				}
			}
		}
		return null;
	}
	/**
	 * 压实温度过高（A0002）
	 * @param vehicle
	 * @param signal
	 * @param rule
	 * @return
	 */
	public RoadAlarmInfo alarmA0002(Road_Vehicle vehicle, Road_GpsSignal_Roller signal, RoadAlarmRule rule) {
		if (null == rule.Value1 || null == rule.Value2) {
			return null;
		}
		VariableData variable = CacheManager.instance().getVariable(signal.gpsNo);
		if (signal.rollerTemp < Double.valueOf(rule.Value1)) {
			variable.overRollerTempA0002 = null;
			variable.lastAlarmTimeA0002 = null;
			variable.beginSignalIdA0002 = null;
			return null;
		}
		if (signal.accStatus == 0) {
			variable.overRollerTempA0002 = null;
			variable.lastAlarmTimeA0002 = null;
			variable.beginSignalIdA0002 = null;
			return null;
		}
		if (variable.beginSignalIdA0002 == null) {
			variable.beginSignalIdA0002 = signal.signalId;
		}
		if (variable.overRollerTempA0002 == null) {
			variable.overRollerTempA0002 = signal.gpsTime;
		} else {
			long time = (signal.gpsTime.getTime() - variable.overRollerTempA0002.getTime()) / 1000L;
			if (time > Integer.valueOf(rule.Value2) * 60) {
				if (variable.lastAlarmTimeA0002 == null) {
					variable.lastAlarmTimeA0002 = signal.gpsTime;
					RoadAlarmInfo rai = AlarmTool.createRoadAlarmInfo(vehicle, signal, rule);
					// rai.AlarmInfo = "压实最高温度为[" + rule.Value1 + "℃]，报警时温度为[" +
					// temp + "℃],持续时间"+ time / 60L + "分" + time % 60L + "秒";
					rai.AlarmInfo = "压实温度过高";
					rai.EquipmentKind = vehicle.equipmentKind;
					rai.BeginSignalId = variable.beginSignalIdA0002;
					rai.EndSignalId = signal.signalId;
					variable.beginSignalIdA0002 = signal.signalId;
					return rai;
				}
				long time1 = (signal.gpsTime.getTime() - variable.lastAlarmTimeA0002.getTime()) / 1000L;
				if (time1 > Integer.valueOf(rule.Value2) * 60) {
					variable.lastAlarmTimeA0002 = signal.gpsTime;
					RoadAlarmInfo rai = AlarmTool.createRoadAlarmInfo(vehicle, signal, rule);
					// rai.AlarmInfo = "压实最高温度为[" + rule.Value1 + "℃]，报警时温度为[" +
					// temp + "℃],持续时间"+ time / 60L + "分" + time % 60L + "秒";
					rai.AlarmInfo = "压实温度过高";
					rai.EquipmentKind = vehicle.equipmentKind;
					rai.BeginSignalId = variable.beginSignalIdA0002;
					rai.EndSignalId = signal.signalId;
					variable.beginSignalIdA0002 = signal.signalId;
					return rai;
				}
			}
		}
		return null;
	}
	/**
	 * 压实速度过低（A0003）
	 * @param vehicle
	 * @param signal
	 * @param rule
	 * @return
	 */
	public RoadAlarmInfo alarmA0003(Road_Vehicle vehicle, Road_GpsSignal_Roller signal, RoadAlarmRule rule) {
		if (null == rule.Value1 || null == rule.Value2) {
			return null;
		}
		VariableData variable = CacheManager.instance().getVariable(signal.gpsNo);
		if (signal.speed > Double.valueOf(rule.Value1)) {
			variable.lowRollerSpeedA0003 = null;
			variable.lastAlarmTimeA0003 = null;
			variable.beginSignalIdA0003 = null;
			return null;
		}
		if (signal.accStatus == 0) {
			variable.lowRollerSpeedA0003 = null;
			variable.lastAlarmTimeA0003 = null;
			variable.beginSignalIdA0003 = null;
			return null;
		}
		if (variable.beginSignalIdA0003 == null) {
			variable.beginSignalIdA0003 = signal.signalId;
		}
		if (variable.lowRollerSpeedA0003 == null) {
			variable.lowRollerSpeedA0003 = signal.gpsTime;
		} else {
			long time = (signal.gpsTime.getTime() - variable.lowRollerSpeedA0003.getTime()) / 1000L;
			if (time > Integer.valueOf(rule.Value2) * 60) {
				if (variable.lastAlarmTimeA0003 == null) {
					variable.lastAlarmTimeA0003 = signal.gpsTime;
					RoadAlarmInfo rai = AlarmTool.createRoadAlarmInfo(vehicle, signal, rule);
					// rai.AlarmInfo = "压实最低速度为[" + rule.Value1 +
					// "r/min]，报警时速度为[" + signal.speed + "r/min],持续时间"+ time /
					// 60L + "分" + time % 60L + "秒";
					rai.AlarmInfo = "压实速度过低";
					rai.EquipmentKind = vehicle.equipmentKind;
					rai.BeginSignalId = variable.beginSignalIdA0003;
					rai.EndSignalId = signal.signalId;
					variable.beginSignalIdA0003 = signal.signalId;
					return rai;
				}
				long time1 = (signal.gpsTime.getTime() - variable.lastAlarmTimeA0003.getTime()) / 1000L;
				if (time1 > Integer.valueOf(rule.Value2) * 60) {
					variable.lastAlarmTimeA0003 = signal.gpsTime;
					RoadAlarmInfo rai = AlarmTool.createRoadAlarmInfo(vehicle, signal, rule);
					// rai.AlarmInfo = "压实最低速度为[" + rule.Value1 +
					// "r/min]，报警时速度为[" + signal.speed + "r/min],持续时间"+ time /
					// 60L + "分" + time % 60L + "秒";
					rai.AlarmInfo = "压实速度过低";
					rai.EquipmentKind = vehicle.equipmentKind;
					rai.BeginSignalId = variable.beginSignalIdA0003;
					rai.EndSignalId = signal.signalId;
					variable.beginSignalIdA0003 = signal.signalId;
					return rai;
				}
			}
		}
		return null;
	}
	/**
	 * 压实速度过高（A0004）
	 * @param vehicle
	 * @param signal
	 * @param rule
	 * @return
	 */
	public RoadAlarmInfo alarmA0004(Road_Vehicle vehicle, Road_GpsSignal_Roller signal, RoadAlarmRule rule) {
		if (null == rule.Value1 || null == rule.Value2) {
			return null;
		}
		VariableData variable = CacheManager.instance().getVariable(signal.gpsNo);
		if (signal.speed < Double.valueOf(rule.Value1)) {
			variable.overRollerSpeedA0004 = null;
			variable.lastAlarmTimeA0004 = null;
			variable.beginSignalIdA0004 = null;
			return null;
		}
		if (signal.accStatus == 0) {
			variable.overRollerSpeedA0004 = null;
			variable.lastAlarmTimeA0004 = null;
			variable.beginSignalIdA0004 = null;
			return null;
		}
		if (variable.beginSignalIdA0004 == null) {
			variable.beginSignalIdA0004 = signal.signalId;
		}
		if (variable.overRollerSpeedA0004 == null) {
			variable.overRollerSpeedA0004 = signal.gpsTime;
		} else {
			long time = (signal.gpsTime.getTime() - variable.overRollerSpeedA0004.getTime()) / 1000L;
			if (time > Integer.valueOf(rule.Value2) * 60) {
				if (variable.lastAlarmTimeA0004 == null) {
					variable.lastAlarmTimeA0004 = signal.gpsTime;
					RoadAlarmInfo rai = AlarmTool.createRoadAlarmInfo(vehicle, signal, rule);
					// rai.AlarmInfo = "压实最高速度为[" + rule.Value1 +
					// "r/min]，报警时速度为[" + signal.speed + "r/min],持续时间"+ time /
					// 60L + "分" + time % 60L + "秒";
					rai.AlarmInfo = "压实速度过高";
					rai.EquipmentKind = vehicle.equipmentKind;
					rai.BeginSignalId = variable.beginSignalIdA0004;
					rai.EndSignalId = signal.signalId;
					variable.beginSignalIdA0004 = signal.signalId;
					return rai;
				}
				long time1 = (signal.gpsTime.getTime() - variable.lastAlarmTimeA0004.getTime()) / 1000L;
				if (time1 > Integer.valueOf(rule.Value2) * 60) {
					variable.lastAlarmTimeA0004 = signal.gpsTime;
					RoadAlarmInfo rai = AlarmTool.createRoadAlarmInfo(vehicle, signal, rule);
					// rai.AlarmInfo = "压实最高速度为[" + rule.Value1 +
					// "r/min]，报警时速度为[" + signal.speed + "r/min],持续时间"+ time /
					// 60L + "分" + time % 60L + "秒";
					rai.AlarmInfo = "压实速度过高";
					rai.EquipmentKind = vehicle.equipmentKind;
					rai.BeginSignalId = variable.beginSignalIdA0004;
					rai.EndSignalId = signal.signalId;
					variable.beginSignalIdA0004 = signal.signalId;
					return rai;
				}
			}
		}
		return null;
	}
}
